import { createRouter, RouteRecordRaw, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: '/home',
        component: import(/* webpackChunkName: "home" */ '../views/home/index.vue')
      },
      {
        path: '/setting/menuAdmin',
        component: import(/* webpackChunkName: "MenuAdmin" */ '../views/setting/MenuAdmin.vue')
      },
      {
        path: '/setting/roleAdmin',
        component: import(/* webpackChunkName: "roleAdmin" */ '../views/setting/roleAdmin.vue')
      },
      {
        path: '/setting/accountAdmin',
        component: import(/* webpackChunkName: "accountAdmin" */ '../views/setting/accountAdmin.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/LoginView.vue')
  },
]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
